Fix PostgreSQL 17 Deparser Support - NULLS NOT DISTINCT Constraints #143
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix PostgreSQL 17 Deparser Support
Summary
Fixed failing deparser test in
misc-issues.test.tsby implementing support for PostgreSQL 17 features, specifically theNULLS NOT DISTINCTconstraint syntax.Changes Made
nulls_not_distinctproperty in the UNIQUE constraint handler indeparser.tsTechnical Details
The issue was in the
visitConstraintmethod where the deparser wasn't handling thenulls_not_distinctproperty for UNIQUE constraints. Added a conditional check to output "NULLS NOT DISTINCT" when this property is true.Test Results
All PostgreSQL 17 features in the misc-issues test now work correctly:
GENERATED BY DEFAULT AS IDENTITYcolumnsUNIQUE NULLS NOT DISTINCTconstraintsVerification
Link to Devin run
https://app.devin.ai/sessions/e2a49c9a83094092a217b1c66ad778de
Requested by: Dan Lynch ([email protected])